#include "tkeyboardcontroller.h"
#include "ttank.h"

TKeyboardController::TKeyboardController(TObject* object):
        TObjectController(object)
{
}

void TKeyboardController::control(int command){
    switch(command){
    case Qt::Key_Up:
        _object -> setState(UP);
        break;
    case Qt::Key_Right:
        _object -> setState(RIGHT);
        break;
    case Qt::Key_Down:
        _object -> setState(DOWN);
        break;
    case Qt::Key_Left:
        _object -> setState(LEFT);
        break;
    case Qt::Key_Space:
        _object -> setState(SHOOT);
        break;
    }
}
